package demo.example.exception;


public enum TTExceptionEnum {


    NEED_USER_NAME(10001, "用户名不能为空"),
    NEED_PASSWORD(10002, "密码不能为空"),
    PASSWORD_TOO_SHORT(10003, "密码长度不能小于8位"),
    NAME_EXISTED(10004, "不允许重名"),
    INSERT_FAILED(10005, "插入失败，请重试"),
    WRONG_PASSWORD(10006, "密码错误"),
    NEED_LOGIN(10007, "用户未登录"),
    UPDATE_FAILED(10008, "更新失败"),
    NEED_ADMIN(10009, "无管理员权限"),
    PARA_NOT_NULL(10010, "参数不能为空"),
    CREATE_FAILED(10011, "新增失败"),
    REQUEST_PARAM_ERROR(10012, "参数错误"),
    NEED_PHONE(10013, "必须填写电话号码"),
    PHONE_EXISTED(10014, "电话号码已存在"),
    GET_ALL_MESSAGE_ERROR(10015,"查询数据为空或者查询数据库异常"),
    PHONE_ERROR(10015, "电话号码长度必须为11位"),
    SEX_ERROR(10016, "性别只能为男或者女"),
    PHONE_FORMAT_ERROR(10017, "电话号码格式错误，只能为大陆手机号码"),
    NOT_ADMIN(10018,"没有管理员权限"),
    PAGE_ERROR(10019,"请传入正确的分页信息"),
    SYSTEM_ERROR(20000, "系统异常，请从控制台或日志中查看具体错误信息");
    /**
     * 异常码
     */
    Integer code;
    /**
     * 异常信息
     */
    String msg;

    TTExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }



}
